package com.fire.utils;

/**
 * ClassName: FormatTimeUtils
 * Package: com.fire.utils
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/4/4 - 1:32
 * @Version: v1.0
 */

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 格式化时间工具
 */
public class FormatTimeUtil {

    public static String formatTime(String time){
        DateTimeFormatter inputFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
        ZonedDateTime dateTime = ZonedDateTime.parse(time, inputFormatter);
        DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return dateTime.format(outputFormatter);
    }
}
